package fmod.org.smali.myapplication.activitys;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.view.GestureDetector;

import fmod.org.smali.myapplication.R;
import fmod.org.smali.myapplication.fragments.DragableViewFragment;
import fmod.org.smali.myapplication.fragments.GestureTestFragment;
import fmod.org.smali.myapplication.fragments.PlayerFragment;
import fmod.org.smali.myapplication.fragments.ScrollerLayoutFragment;
import fmod.org.smali.myapplication.fragments.ShareDemoFragment;
import fmod.org.smali.myapplication.views.ScrollerLayout;

public class DetailActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detial);
        String itemName = getIntent().getStringExtra("itemName");
        Fragment fragment=null;
        switch (itemName){
            case "ShareDemoFragment":
                fragment = ShareDemoFragment.newInstance("", "");
                break;
            case "DragableViewFragment":
                fragment = DragableViewFragment.newInstance("", "");
                break;
            case "PlayerFragment":
                 fragment = PlayerFragment.newInstance("", "");
                break;
            case "ScrollerLayoutFragment":
                 fragment = ScrollerLayoutFragment.newInstance();
            case "GestureTest":
                fragment = GestureTestFragment.newInstance();
                break;
        }
        getSupportFragmentManager().beginTransaction().replace(R.id.fl,fragment).commit();
    }

}
